package com.business.action.oa;

import java.util.List;

import com.business.bean.oa.DispatchWorkFile;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import net.sf.rose.jdbc.PageBean;
import net.sf.rose.jdbc.dao.BeanDAO;
import net.sf.rose.jdbc.query.BeanSQL;
import net.sf.rose.jdbc.service.Service;

/**
 * 调度
 * 
 * @author fengjian
 *
 */
@Controller
@RequestMapping("/oa/dispatch/file")
public class DispatchFileAction {

	/**
	 * 获取某个工程调度的附件图片记录
	 */
	@ResponseBody
	@RequestMapping("/work/get.do")
	public PageBean getDispatchWork(Service service, DispatchWorkFile workFile) {
		PageBean page = new PageBean();
		BeanDAO dao = new BeanDAO(service);
		BeanSQL query = dao.getQuerySQL();
		query.setEntityClass(DispatchWorkFile.class);
		query.setTableName("OA_DISPATCH_WORK_FILE_VIEW");
		query.createSql(workFile);
		query.addOrderby("sequence");
		List<DispatchWorkFile> list = dao.list();
		page.setData(list);
		return page;
	}
}
